package com.hesc.minio.conf;

import io.minio.MinioClient;
import io.minio.messages.Prefix;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration()
@ConfigurationProperties(prefix = "minio")
public class MinIOConfig {

    private String endpoint;
    private String accesskey;
    private String accesssecret;

    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder().endpoint(endpoint).credentials(accesskey, accesssecret).build();
    }
}
